﻿using LitJson;
using OestsCommon.TcpNet;
using OestsServer.Managers;
using OestsServer.Net;

namespace OestsServer.Handlers
{
	public class DeletePlayerHandler : HandlerBase
	{
		public override PacketKey PKey => PacketKey.DeletePlayer;

		public override void Execute(ClientChannel client, Request ResquestPacket)
		{
			//int[] arr = JsonMapper.ToObject<int[]>(ResquestPacket.DataStr);
			//foreach (var room in RoomManager.Instance.RoomList)
			//{
			//	if (room.RoomId == arr[0])
			//	{
					////删除成员
					//room.StudentTemps.Remove(arr[1]);
					////清除该玩家扮演的岗位信息
					//if (room.DicPostIdStudentId.ContainsValue(arr[1]))
					//{
					//	foreach (var item in room.DicPostIdStudentId)
					//	{
					//		if (item.Value == arr[1])
					//		{
					//			room.DicPostIdStudentId[item.Key] = 0;
					//			break;
					//		}
					//	}
					//}
					//Struct2<Room, int> s = new Struct2<Room, int>(room, arr[1]);
					////反馈任务开始
					//ResponsePacket.DataObject = s;

					////广播 
					//BroadcastInRoom(room, ResponsePacket);
					//SendToStudent(arr[1], ResponsePacket);//删除掉的学员接收
			//		break;
			//	}
			//}
		}
	}
}
